package com.example.kotlinstudy.基本类型

val str = "abcd 123"
fun main() {
    val str = "abcd"
    for (c in str) {
        println(c)
    }
    println(str.uppercase())
    println(str)

    val s = "abc" + 1
    println(s + "def")

    val s1 = "hello, world!\n"
    val text = """
        for(c in "foo")
            print(c)
    """.trimIndent()
    println(text)

    //trimIndent取消前导空格
    val text1 = """
        |Tell me and I forget
        |Tech me and I remember
        |Involve me and I learn
        |(Benjamin Franklin)
    """.trimIndent()
    println(text1)

    //以竖线|为边界前缀
    val text2 = """
        |Tell me and I forget
        |Tech me and I remember
        |Involve me and I learn
        |(Benjamin Franklin)
    """.trimMargin("|")
    println(text2)

    val i = 10
    println("i = $i")

    val s2 = "abc"
    println("$s2.length is ${s2.length}")

    //插入美元字符
    val price = """
        ${'$'}_9.99
    """
    println(price)
}